#ifndef __VIEW_WITH_THRESHOLD__H
#define __VIEW_WITH_THRESHOLD__H
#include "View.h"
template <int N>
class ViewWithThreshold : public View
{
public:
	ViewWithThreshold(const Image *pImage, F64 nCenterRow, F64 nCenterCol, F64 nCenterAngle) : 
		View(pImage, nCenterRow, nCenterCol, nCenterAngle) {}
	ViewWithThreshold(const Image *pImage, const ViewState *pState) : 
		View(pImage, pState) {}
	// this routine is needed for us to work thresholded with RunFinder
	// (compile-time polymorphism) (this is the whole purpose of this class)
	U8 GetPix(F64 nRow, F64 nCol) const { return View::GetPix(nRow, nCol) > N ? 255 : 0; } 
	ViewWithThreshold<N> *GetThis() { return this; }
	const ViewWithThreshold<N> *GetThis() const { return this; }
	
};

typedef ViewWithThreshold<127> ViewBW;
#endif//__VIEW_WITH_THRESHOLD__H
